access_log: add OTLP/HTTP exporter to OpenTelemetry access logger#42445
access_log: add OTLP/HTTP exporter to OpenTelemetry access logger#42445wbpcode merged 2 commits intoenvoyproxy:mainfrom
Conversation
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
8831406 to
3664f4e
Compare
a50beca to
7adc68b
Compare
configs/envoy-otel-http.yaml
Outdated
| resource_detectors: | ||
| - name: envoy.tracers.opentelemetry.resource_detectors.environment | ||
| typed_config: | ||
| "@type": type.googleapis.com/envoy.extensions.tracers.opentelemetry.resource_detectors.v3.EnvironmentResourceDetectorConfig |
There was a problem hiding this comment.
ok this now uses the current practice with is resource detectors, not a one-off, even though the one-off in grpc+accesslog is retained for deprecation
e8271a1 to
0e06aa1
Compare
0e06aa1 to
964e660
Compare
ed98708 to
2b7c12d
Compare
|
noticed other examples use httpbingo not httpbin, since no one has reviewed yet I switched to the former and updated the screenshots🤞 |
2b7c12d to
a76243d
Compare
|
@TAOXUY this might be interesting to you. I'm happy to continue and do metrics after this once merged |
a76243d to
981d433
Compare
3a0b56a to
124073f
Compare
|
Thanks for working on this @codefromthecrypt Please merge main. Would it be possible to make test/extensions/access_loggers/open_telemetry/access_log_integration_test.cc test both HTTP and gRPC exporter? This will make it easier to reason that two exporters behave the same. /wait |
124073f to
ac0c89c
Compare
|
@yanavlasov added a commit that I think gets what you are saying. thanks for the tip |
ac0c89c to
5899a70
Compare
| public HttpIntegrationTest { | ||
| enum class ExporterType { GRPC, HTTP }; | ||
|
|
||
| struct TransportDriver { |
There was a problem hiding this comment.
wasn't quite sure style, but this is how I was thinking about parameterizing so it is easy to see if these behave the same except the different parts. thanks for the idea @yanavlasov as it found a bug I fixed!
Signed-off-by: Adrian Cole <adrian@tetrate.io>
Signed-off-by: Adrian Cole <adrian@tetrate.io>
5899a70 to
2143126
Compare
|
LGTM. Will wait for @mattklein123 for API review. /wait-any |
Adds HTTP transport support to the OpenTelemetry metrics sink, complementing envoyproxy#42445 (OTLP/HTTP access logs) and envoyproxy#29207 (OTLP/HTTP tracing. This enables direct OTLP metrics export to backends that only accept HTTP (Dynatrace, Datadog, Elastic), without requiring an intermediate collector sidecar. - Add field to oneof - Create abstract base class - Rename to EOF ) Signed-off-by: Adrian Cole <adrian@tetrate.io>
|
thanks all #43001 completes the otlp http transport by supporting metrics (we already supported traces, and this PR did access logs, only left was metrics) |
Adds HTTP transport support to the OpenTelemetry metrics sink, complementing envoyproxy#42445 (OTLP/HTTP access logs) and envoyproxy#29207 (OTLP/HTTP tracing. This enables direct OTLP metrics export to backends that only accept HTTP (Dynatrace, Datadog, Elastic), without requiring an intermediate collector sidecar. - Add field to oneof - Create abstract base class - Rename to EOF ) Signed-off-by: Adrian Cole <adrian@tetrate.io>
**Description** Switches OTLP default transport from HTTP to gRPC in test fixtures and examples. This prepares for Envoy Gateway integration which currently only supports OTLP/gRPC for access logs. Once Envoy Gateway exposes OTLP/HTTP (pending upstream changes in Envoy), we can switch back. **Related Issues/PRs (if applicable)** - envoyproxy/envoy#42445 (OTLP/HTTP access logs in Envoy) - envoyproxy/gateway#7674 (OTLP headers support) Signed-off-by: Adrian Cole <adrian@tetrate.io>
Adds HTTP transport support to the OpenTelemetry metrics sink, complementing envoyproxy#42445 (OTLP/HTTP access logs) and envoyproxy#29207 (OTLP/HTTP tracing. This enables direct OTLP metrics export to backends that only accept HTTP (Dynatrace, Datadog, Elastic), without requiring an intermediate collector sidecar. - Add field to oneof - Create abstract base class - Rename to EOF ) Signed-off-by: Adrian Cole <adrian@tetrate.io>
) **Additional Description**: Adds HTTP transport support to the OpenTelemetry metrics sink, complementing #42445 (OTLP/HTTP access logs) and #29207 (OTLP/HTTP tracing). This enables direct OTLP metrics export to backends that only accept HTTP (Dynatrace, Datadog, Elastic), without requiring an intermediate collector sidecar. Also refactors the exporter to use an abstract base class: - Add `http_service` field to `protocol_specifier` oneof for OTLP/HTTP transport - Create abstract `OtlpMetricsExporter` base class - Rename `OpenTelemetryGrpcSink` to `OpenTelemetrySink` with generic exporter **Risk Level**: Low (new optional feature, backward compatible) **Testing**: Unit tests, integration test, manual testing with OTel collector **Docs Changes**: Proto documentation updated **Release Notes**: Added **Example Configuration (OTLP/HTTP)** ```yaml stats_sinks: - name: envoy.stat_sinks.open_telemetry typed_config: "@type": type.googleapis.com/envoy.extensions.stat_sinks.open_telemetry.v3.SinkConfig http_service: http_uri: uri: "http://localhost:4318/v1/metrics" cluster: otel_collector timeout: 1s report_counters_as_deltas: true report_histograms_as_deltas: true emit_tags_as_attributes: true use_tag_extracted_name: true ``` **Example Configuration (OTLP/gRPC - unchanged)** ```yaml stats_sinks: - name: envoy.stat_sinks.open_telemetry typed_config: "@type": type.googleapis.com/envoy.extensions.stat_sinks.open_telemetry.v3.SinkConfig grpc_service: envoy_grpc: cluster_name: otel_collector report_counters_as_deltas: true ``` Screenshot of metrics from http transport in otel-tui <img width="1288" height="734" alt="Screenshot 2026-01-14 at 8 46 27 PM" src="https://github.com/user-attachments/assets/49d57f12-61a4-4b0d-9dbc-8b9ad3339554" /> --------- Signed-off-by: Adrian Cole <adrian@tetrate.io> Signed-off-by: Adrian Cole <64215+codefromthecrypt@users.noreply.github.com> Signed-off-by: code <wbphub@gmail.com> Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com> Co-authored-by: code <wbphub@gmail.com>
…oyproxy#43001) **Additional Description**: Adds HTTP transport support to the OpenTelemetry metrics sink, complementing envoyproxy#42445 (OTLP/HTTP access logs) and envoyproxy#29207 (OTLP/HTTP tracing). This enables direct OTLP metrics export to backends that only accept HTTP (Dynatrace, Datadog, Elastic), without requiring an intermediate collector sidecar. Also refactors the exporter to use an abstract base class: - Add `http_service` field to `protocol_specifier` oneof for OTLP/HTTP transport - Create abstract `OtlpMetricsExporter` base class - Rename `OpenTelemetryGrpcSink` to `OpenTelemetrySink` with generic exporter **Risk Level**: Low (new optional feature, backward compatible) **Testing**: Unit tests, integration test, manual testing with OTel collector **Docs Changes**: Proto documentation updated **Release Notes**: Added **Example Configuration (OTLP/HTTP)** ```yaml stats_sinks: - name: envoy.stat_sinks.open_telemetry typed_config: "@type": type.googleapis.com/envoy.extensions.stat_sinks.open_telemetry.v3.SinkConfig http_service: http_uri: uri: "http://localhost:4318/v1/metrics" cluster: otel_collector timeout: 1s report_counters_as_deltas: true report_histograms_as_deltas: true emit_tags_as_attributes: true use_tag_extracted_name: true ``` **Example Configuration (OTLP/gRPC - unchanged)** ```yaml stats_sinks: - name: envoy.stat_sinks.open_telemetry typed_config: "@type": type.googleapis.com/envoy.extensions.stat_sinks.open_telemetry.v3.SinkConfig grpc_service: envoy_grpc: cluster_name: otel_collector report_counters_as_deltas: true ``` Screenshot of metrics from http transport in otel-tui <img width="1288" height="734" alt="Screenshot 2026-01-14 at 8 46 27 PM" src="https://github.com/user-attachments/assets/49d57f12-61a4-4b0d-9dbc-8b9ad3339554" /> --------- Signed-off-by: Adrian Cole <adrian@tetrate.io> Signed-off-by: Adrian Cole <64215+codefromthecrypt@users.noreply.github.com> Signed-off-by: code <wbphub@gmail.com> Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com> Co-authored-by: code <wbphub@gmail.com>
Commit Message: access_log: add OTLP/HTTP exporter to OpenTelemetry access logger
Additional Description: Adds HTTP transport support to the OpenTelemetry access logger, complementing #29207 (OTLP/HTTP tracing). This enables direct OTLP log export to backends that only accept HTTP (Dynatrace, Datadog, Logfire), without requiring an intermediate collector sidecar.
Also refactors the config to match the tracer pattern:
http_servicefield for OTLP/HTTP transportgrpc_serviceandlog_namefieldscommon_configfield (still functional for backward compatibility)otlp_log_utils) for HTTP and gRPC implementationsRisk Level: Low (new optional feature, backward compatible)
Testing: Unit tests, integration test, manual testing with OTel collector
Docs Changes: Proto documentation updated
Release Notes: Added
Fixes #26352 (access logs portion)
Example Configuration (OTLP/HTTP with resource_attributes)
Example Configuration (OTLP/gRPC - top-level field)
Screenshots

